package com.pro.controller;

import com.pro.pojo.JsLog;
import com.pro.pojo.JsonData;
import com.pro.service.JsLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * ClassName:JsLogController
 * Package:com.pro.controller
 * Description:
 *
 * @Date:2022/1/8 16:36
 * @Author: ZPT
 */
@RestController
@RequestMapping("/jsLog")
public class JsLogController {

    @Autowired
    private JsLogService jsLogService;
    /**
     *
     * @author ZPT
     * @date 2022/1/8 16:32
     * @content :查看操作日志数据
     */
    @RequestMapping("/getLog")
    public JsonData getLog(Integer logType,String trueName,String createDate,String type){
        List<JsLog> logList = jsLogService.getLog(logType,trueName,createDate,type);
        return logList!=null?JsonData.buildSuccess(logList):JsonData.buildError("服务端错误");
    }
    /**
     *
     * @author ZPT
     * @date 2022/1/8 16:57
     * @content :删除操作日志
     */
    @RequestMapping("/deleteLog")
    public JsonData deleteLog(Integer logId){
        Boolean aBoolean = jsLogService.deleteLog(logId);
        return aBoolean!=null?JsonData.buildSuccess(aBoolean):JsonData.buildError("服务端错误");
    }
}
